package com.chuangzhi.yygh.user.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sentinel")

public class IndexController {

    /**
     * sentinel 簡單配置 demo application+pom依賴
     * @return
     */
    //限流
    @GetMapping("/testA")
    public String testA(){
        return "testA";
    }
    //熱點
    @SentinelResource(value = "sendTestB",blockHandler = "gettestB")
    @PostMapping(value="testB")
    public String testB(@RequestParam String mobile){
        System.out.println("get testB success");
        return "OK";
    }
    public String gettestB(@RequestParam String mobile){
        System.out.println("get testB err");
        return "testB 失败";
    }


}

